package com.group.mapper;


import pojo.entity.Order;
import pojo.entity.OrderGood;
import pojo.qo.GoodSales;
import pojo.qo.ShopOrder;
import pojo.qo.UserOrder;

import java.util.List;

public interface OrderMapper {
    /**
     * 用户订单获取
     * @param order
     * @return
     */
    List<Order> getOrderByUserId(Order order);

    /**
     * 获取分页订单信息
     * @return
     */
    List<Order> getSomeOrder(Long userId);

    /**
     * 通过订单状态获取订单
     * @param order
     * @return
     */
    List<Order> getOrderByStatus(Order order);

    /**
     * 通过订单号获取订单
     * @param order
     * @return
     */
    List<ShopOrder> getOrderByOrderNumber(Order order);

    /**
     * 订单和商品的关联关系获取
     * @param order
     * @return
     */
    List<OrderGood>getGoodsByOrder(Order order);

    /**
     * 修改订单状态
     * @param order
     * @return
     */
    int updateOrder(Order order);

    /**
     * 新增订单
     * @param order
     * @return
     */
    int addOrder(Order order);

    /**
     * 新增订单商品详情
     * @param orderGood
     * @return
     */
    int addOrderGoods(OrderGood orderGood);

    /**
     * 删除订单(修改状态)
     * @param order
     * @return
     */
    int deleteOrder(Order order);

    /**
     * 修改订单
     * @param order
     * @return
     */
    int updateAddOrder(Order order);

    GoodSales hasGoodSales(Long goodId);

    int updateGoodSales(GoodSales goodSales);


    int addGoodSales(GoodSales goodSales);

    List<Order> selectOrderWithStatus(Order order);

    Order selectOrderByOrderId(Long orderNumber);

    List<ShopOrder>selectTest(Long userId);
}
